package com.stars.services.impl.system;
import com.github.pagehelper.PageInfo;
import com.stars.entity.system.OperationLogEntity;
import com.stars.services.system.OperationLogAccessServices;
import com.stars.dao.mapper.system.OperationLogMapper;
import com.stars.entity.dto.system.OperationLogDTO;

import java.util.List;
import com.stars.entity.ListPage;
import com.github.pagehelper.PageHelper;
import com.stars.services.impl.BaseAccessServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Title: 系统日志 业务逻辑
 * @author dj
 * @date 2019-10-09 19:31:24
 * @version V1.0
 *
 */
@Service
public class OperationLogAccessServicesImpl  extends BaseAccessServiceImpl<OperationLogMapper , OperationLogEntity> implements  OperationLogAccessServices {
    @Autowired
    private OperationLogMapper  operationLogMapper;


    /**
     * 分页查询
     * @param pageNum 查询参数 起始页，大小。
     * @return
     */
    @Override
    public PageInfo<OperationLogDTO> pageList(Integer pageNum, Integer pageSize, OperationLogDTO command) throws Exception{
        ListPage<OperationLogDTO> listPage = new ListPage<>(pageNum, pageSize, command);
        PageHelper.startPage(pageNum, pageSize);
        List<OperationLogDTO> list = operationLogMapper.pageQueryOperationLog(listPage);
        PageInfo<OperationLogDTO> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
